package com.sync.data.mce.repository;

import com.sync.data.mce.entity.BpmDepartmentInfo;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author xianchuang.li
 * @version 1.0.0
 * @since 2025/8/4 19:36
 **/
@Repository
public interface BpmDepartmentInfoRepository extends JpaRepository<BpmDepartmentInfo, String>, JpaSpecificationExecutor<BpmDepartmentInfo>{

    @Query("SELECT b FROM BpmDepartmentInfo b where b.deptId is not null GROUP BY b.deptId ")
    Page<BpmDepartmentInfo> findAllGroupByDeptId(Pageable pageable);
}
